package chapter04.Example18;
class  Animal{
    void shout(){
        System.out.println("动物叫！");
    }
    public  String toString(){
        return "我是动物类";
    }
}
class Dog extends Animal {
    public  void shout(){
        System.out.println("狗叫!");
    }
}
public class Example18 {
    public static void main(String [] args){
         Animal animal = new Animal();
         System.out.println(animal.toString());
    }
}
